<?php
  
	$results = mysql_query("SELECT * FROM tournamentPlayer");
	$names = Array();
	while ($row = mysql_fetch_array($results)) {
		array_push($names, $row["playerLastname"]);
	}
	echo count($names);
	$similars = 0;
	$sames = 0;
	for ($i = 0; $i < count($names) ; $i++) {
		for ($j = $i + 1; $j < count($names) ; $j++) {
				$name1 = $names[$i];
				$name2 = $names[$j];
				similar_text($name1, $name2, $percent);
				if (80 < $percent && $percent < 100) {
					$similars++;
					echo $name1 . " " . $name2 . " = " . $percent . "<br/>";
				} else if ($percent == 100) {
					$sames++;
				}
		}
	}
	echo "<br/><br/>Sames : " . $sames;
	echo "<br/><br/>Similars : " . $similars;
?>
